#ifndef LOGGER_H
#define LOGGER_H

//QT
#include <QIODevice>
#include <QTextStream>

class Logger
{
public:
    //Constants
    static const char   DEBUG = 1;
    static const char   NOTICE = 2;
    static const char   WARNING = 3;
    static const char   ERROR = 4;

    //Singleton
    static Logger *instance ()
    {
        if (m_instance == 0)
            m_instance = new Logger();

        return (m_instance);
    }
    ~Logger ()
    {
        m_instance = 0;
    }

    void setOutput(QTextStream *textStream);
    void setLevel(int level);
    void log(QString message, int level);
private:
    static Logger *m_instance;

    QTextStream *textStream;
    int level;
};

#endif // LOGGER_H
